﻿using System;
using System.IO;
using Storm.TextEditor.Editor.CodeCompletion;
using Moonlite.ExtensionApi.GlobalInterfaces;

namespace Moonlite.Platform.Text.File
{
    public static class SnippetCompletionDataFactory
    {
        private const int ImageIndexSnippet = 8;
        public static CompletionDataCollection CreateSnippetData(SnippetCollection snippets)
        {
            CompletionDataCollection data = new CompletionDataCollection();
            foreach (ISnippet snippet in snippets)
            {
                SnippetCompletionData snippetData = new SnippetCompletionData(ImageIndexSnippet, Path.GetFileNameWithoutExtension(snippet.File), "");
                snippetData.Snippet = snippet;
                data.Add(snippetData);
            }

            return data;
        }
    }
}
